﻿<table class="table table-striped table-bordered table-condensed" style="width: 100%; margin-bottom: 0px;">
    <thead>
        <tr>
            <th style="width: 75px;" rowspan="2">Время
            </th>
            <th colspan="6">Дни недели
            </th>
        </tr>
        <tr data-bind="foreach: weekDayDates">
            <th data-bind="text: date"></th>
        </tr>
    </thead>
    <tbody data-bind="foreach: times">
        <tr>
            <td data-bind="html: '<b>' + StartTime + '</b> - <b>' + EndTime + '</b>'" style="min-width: 75px; height: 100px;"></td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 1}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[0][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="1" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[0][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[0][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[0][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[0][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[0][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[0][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[0][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 2}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[1][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="2" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[1][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[1][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[1][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[1][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[1][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[1][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[1][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 3}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[2][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="3" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[2][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[2][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[2][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[2][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[2][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[2][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[2][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 4}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[3][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="4" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[3][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[3][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[3][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[3][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[3][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[3][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[3][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 5}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[4][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="5" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[4][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[4][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[4][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[4][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[4][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[4][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[4][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
            <td data-bind="css: { 'active' : $root.currentDay().getDay() == 6}, attr: { 'data-periodid': $index(), 'data-scheduleid': $root.schedule()[5][$index()].Id }, event : { dblclick: $root.showDialog, click: $root.scheduleTicketClick }" data-dayofweek="6" style="cursor: pointer;">
                <div data-bind="if: $root.schedule()[5][$index()].Id !== undefined">
                    @*                                <p>Предмет: <b><span data-bind="text: $root.schedule()[5][$index()].TutorialName"></span></b> (<span data-bind="text: $root.schedule()[5][$index()].TutorialTypeName"></span>)</p>
                                <p>Факультет: <b><span data-bind="text: $root.schedule()[5][$index()].FacultyName"></span></b>, <b><span data-bind="text: $root.schedule()[5][$index()].CourseName"></span></b>, <b><span data-bind="text: $root.schedule()[5][$index()].GroupCode"></span></b></p>
                                <p>Преподаватель: <b><span data-bind="text: $root.schedule()[5][$index()].Lecturer"></span></b></p>*@
                </div>
            </td>
        </tr>
    </tbody>
</table>
